package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.CrmCustomerImportRecordAddDTO;
import org.jsola.hr.dto.CrmCustomerImportRecordUpdateDTO;
import org.jsola.hr.query.AttendanceDataTempQuery;
import org.jsola.hr.query.CrmCustomerImportRecordQuery;
import org.jsola.hr.vo.*;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 导入客户记录表
 *
 * @author zhr
 */
@Api(tags = "hr-导入客户记录表")
public interface ICrmCustomerImportRecordControllerAPI {

    /**
     * 根据导入客户记录表id导出错误数据excel
     * @param crmCustomerImportRecordId 导入客户记录表id
     * @return 导入客户记录表详情
     */
    @ApiOperation(value="根据导入客户记录表id导出错误数据excel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordId", dataType = "String", value = "导入客户记录表id", paramType = "path")
    })
    ResponseEntity<Resource> getErrorCustomerData (String crmCustomerImportRecordId);

    /**
     * 导入客户信息
     * @param crmCustomerImportRecordQuery 查询参数
     * @return 成功导入数据量
     */
    @ApiOperation(value = "导入客户信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordQuery", dataType = "CrmCustomerImportRecordQuery", value = "导入客户记录表查询参数", paramType = "query")
    })
    Result<Integer> importCustomerInfo(CrmCustomerImportRecordQuery crmCustomerImportRecordQuery);

    /**
     * 导入excel
     * @param file 上传的文件
     * @return 记录ID
     */
    @ApiOperation(value = "导入excel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file",
                    value = "文件，Content-Type需要设置为multipart/form-data",
                    paramType = "form"),
    })
    Result<CrmCustomerImportRecordVO> importFile(MultipartFile file);

    /**
     * 下载客户信息excel模板
     *
     * @return 文件
     */
    @ApiOperation(value = "下载客户信息excel模板")
    @ApiImplicitParams({
    })
    ResponseEntity<Resource> downloadCustomerTemplate();

    /**
     * 新增导入客户记录表
     * @param crmCustomerImportRecordAddDTO 导入客户记录表新增实体
     * @return 导入客户记录表展示对象
     */
    @ApiOperation(value = "新增导入客户记录表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordAddDTO", dataType = "CrmCustomerImportRecordAddDTO", value = "新增导入客户记录表", paramType = "body")
    })
    Result<CrmCustomerImportRecordVO> save(CrmCustomerImportRecordAddDTO crmCustomerImportRecordAddDTO);


    /**
     * 修改导入客户记录表
     * @param crmCustomerImportRecordUpdateDTO 导入客户记录表
     * @return 更新数量
     */
    @ApiOperation(value = "修改导入客户记录表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordUpdateDTO", dataType = "CrmCustomerImportRecordUpdateDTO", value = "修改导入客户记录表", paramType = "body")
    })
    Result<Integer> update(CrmCustomerImportRecordUpdateDTO crmCustomerImportRecordUpdateDTO);




    /**
     * 删除单个导入客户记录表，彻底删除
     * @param crmCustomerImportRecordId 导入客户记录表id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个导入客户记录表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordId", dataType = "String", value = "导入客户记录表id", paramType = "path")
    })
    Result<Integer> delete(String crmCustomerImportRecordId);


    /**
     * 批量删除导入客户记录表，彻底删除
     * @param crmCustomerImportRecordIds 导入客户记录表id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除导入客户记录表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordIds", dataType = "String[]", value = "导入客户记录表id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] crmCustomerImportRecordIds);


    /**
     * 根据导入客户记录表id查询导入客户记录表详情
     * @param crmCustomerImportRecordId 导入客户记录表id
     * @return 导入客户记录表详情
     */
    @ApiOperation(value="根据导入客户记录表id查询导入客户记录表详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordId", dataType = "String", value = "导入客户记录表id", paramType = "path")
    })
    Result<CrmCustomerImportRecordVO> findById(String crmCustomerImportRecordId);


    /**
     * 查询导入客户记录表
     * @param crmCustomerImportRecordQuery 导入客户记录表查询参数
     * @return page
     */
    @ApiOperation(value="查询导入客户记录表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordQuery", dataType = "CrmCustomerImportRecordQuery", value = "导入客户记录表查询参数", paramType = "query")
    })
    Result<List<CrmCustomerImportRecordListVO>> listAll(CrmCustomerImportRecordQuery crmCustomerImportRecordQuery);


     /**
     * 分页查询导入客户记录表
     * @param crmCustomerImportRecordQuery 导入客户记录表查询参数
     * @return page
     */
    @ApiOperation(value="分页查询导入客户记录表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "crmCustomerImportRecordQuery", dataType = "CrmCustomerImportRecordQuery", value = "导入客户记录表查询参数", paramType = "query")
    })
    Result<Page<CrmCustomerImportRecordListVO>> page(CrmCustomerImportRecordQuery crmCustomerImportRecordQuery);


}

